package com.sh.mytool.cv.domain;

import static javax.persistence.CascadeType.ALL;
import static javax.persistence.FetchType.EAGER;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import com.sh.mytool.cv.domain.ImageGallery;
import javax.persistence.ManyToOne;
import javax.persistence.JoinColumn;
import static javax.persistence.CascadeType.PERSIST;
import static javax.persistence.CascadeType.MERGE;
import static javax.persistence.CascadeType.REFRESH;
@Entity
@Table(name = "tb_image")
public class Image {

    @Id
    @GeneratedValue
    private Long id;
    @OneToOne(cascade = ALL, mappedBy = "image", fetch = EAGER, optional = true)
    private ImageFile imageFile;
    @Column(length = 255)
    private String name;
	@ManyToOne(cascade = { PERSIST, MERGE, REFRESH }, optional = true)
	@JoinColumn(name = "imageGallery_id", referencedColumnName = "id")
	private ImageGallery imageGallery;
	public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public ImageFile getImageFile() {
        return imageFile;
    }

    public void setImageFile(ImageFile param) {
        this.imageFile = param;
    }

    public void setName(String param) {
        this.name = param;
    }

    public String getName() {
        return name;
    }

	public ImageGallery getImageGallery() {
	    return imageGallery;
	}

	public void setImageGallery(ImageGallery param) {
	    this.imageGallery = param;
	}

}